<template>
    <div class="GO-measure-info-wrap">
        <el-form :model="measureFrom" label-width="100px" v-show="!staffTableShow" class="measure-form">
            <el-form-item class="bh-item" label="员工工号" required>
                <el-input placeholder="请输入员工工号查询" suffix-icon="el-icon-search" v-model="measureFrom.searchKeyWord" :style="{ width: '367px', marginRight: '10px' }"> </el-input>
                <el-button class="only-btn" @click="show_customer">查询</el-button>
                <el-button class="only-btn" @click="insertTo_liangti">员工量体列表</el-button>
                <ul class="staff-list">
                    <li class="li-item">
                        <div class="s-item">
                            <span class="label">员工姓名</span>
                            <span class="val">{{customerName}}</span>
                        </div>
                        <div class="s-item">
                            <span class="label">员工工号</span>
                            <span class="val">{{customerCode}}</span>
                        </div>
                        <div class="s-item">
                            <span class="label">性别</span>
                            <span class="val">{{customerSex}}</span>
                        </div>
                    </li>
                </ul>

<!--                <el-radio-group v-model="categoryIds" class="clothing-type" @onchange="select_bodysize()">-->
<!--                    <el-radio-button v-for="(item, index) in productlists" :key="index" :label="item.categoryIds">{{ item.productName }}</el-radio-button>-->
<!--                </el-radio-group>-->

                <el-radio-group  v-model="categoryIds" @change="select_bodysize()" style="margin-top: 18px;">
                    <el-radio-button v-for="(item, index) in productlists" :label="item.id" style="margin: 5px">{{ item.productName }}</el-radio-button>
                </el-radio-group>

            </el-form-item>

            <el-form-item  label="尺码选择" required>
<!--                <el-input v-model="measureFrom.sizeType"> </el-input>-->
<!--                <el-menu :default-active="measureFrom.sizeType" menu-trigger="hover" class="el-menu-demo" mode="horizontal" @select="selectSizeType">-->
<!--                    <el-submenu index="2">-->
<!--                        <template slot="title">自定义尺寸</template>-->
<!--                        <template v-for="(item, index) in sizeTypeList">-->
<!--                            <el-menu-item v-if="!item.children" :index="item.id" :key="index">自定义尺寸</el-menu-item>-->
<!--                            <el-submenu v-if="item.children" :index="item.id" :key="index">-->
<!--                                <template slot="title">{{item.name}}</template>-->
<!--                                <el-menu-item v-for="(v, i) in item.children" :index="`${item.id}-${v.id}`" :key="i">-->
<!--                                    {{v.standardName}}</el-menu-item>-->
<!--                            </el-submenu>-->
<!--                        </template>-->
<!--                    </el-submenu>-->
<!--                </el-menu>-->

<!--                <a-select v-model="select_sex" placeholder="请选择性别" style="color: #a1a19f;">-->
<!--                    <a-select-option :value="item.id" v-for="item in couponList" >{{ item.name }}</a-select-option>-->
<!--                </a-select>-->

                <el-select v-model="select_size" placeholder="请选择">
                    <el-option
                            v-for="item in sizetype"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                    </el-option>
                </el-select>

                <el-select style="margin-left: 10px;" v-model="biaozhunma" placeholder="请选择" v-show="select_size==1">
                    <el-option
                            v-for="item in bzbodysize"
                            :key="item.standardName"
                            :label="item.standardName"
                            :value="item.standardName">
                    </el-option>
                </el-select>
            </el-form-item>

            <el-form-item class="size-form-item" v-show="select_size==0">
                <span slot="label"><i style="color: #F56C6C;"></i> 成衣尺寸</span>
                <el-input style="float: left;width: 250px;margin-left: 10px;margin-top:8px;" v-model="x.bodySizevalue" v-for="(x, index) in sizeData['成衣尺寸']" :key="x.id" placeholder="" @input="pinbodySizeIds" @blur.native.capture="yanzhengChange(x.isBitian,x.min,x.max,x.bodySizevalue)">
                    <span slot="prepend" v-show="x.isBitian==1" style="color: #F56C6C;margin-left: -10px">* </span>
                    <template slot="prepend" style="background-color: #000000">{{x.bodySizename}}</template>
                    <template slot="prepend"><span v-show="x.min!=='' && x.max!=='' && x.min!==null && x.max!==null">({{x.min}}-{{x.max}})</span></template>
                    <template slot="append" style="text-align: left">{{x.unit}}
                    </template>
                </el-input>
            </el-form-item>

            <el-form-item v-show="select_size==0">
                <span slot="label"><i style="color: #F56C6C;"></i> 净体尺寸</span>
                <el-input style="float: left;width: 250px;margin-left: 10px;margin-top:8px;" v-model="x.bodySizevalue" v-for="(x, index) in sizeData['净体尺寸']" :key="x.id" @input="pinbodySizeIds" placeholder="" @blur.native.capture="yanzhengChange(x.isBitian,x.min,x.max,x.bodySizevalue)">
                    <span slot="prepend" v-show="x.isBitian==1" style="color: #F56C6C;margin-left: -10px">* </span>
                    <template slot="prepend" style="background-color: #000000">{{x.bodySizename}}</template>
                    <template slot="prepend"><span v-show="x.min!=='' && x.max!=='' && x.min!==null && x.max!==null">({{x.min}}-{{x.max}})</span></template>
                    <template slot="append">{{x.unit}}</template>
                </el-input>
            </el-form-item>

            <el-form-item label="备注">
                <el-input type="textarea" :rows="5" v-model="liangtiRemark"></el-input>
            </el-form-item>

            <el-form-item class="upload-form-item">
                <lable v-show="liangtiImg!=null && liangtiImg!=''">量体图片：
<!--                    <div v-for="item in liangtiImg" >-->
<!--                        <img :src="item" alt="" height="100px" width="100px" style="float: left;margin-left: 5px"/>-->
<!--                    </div>-->
<!--                    <img :src="liangtiImg" alt="" height="100px" width="100px"/>-->
                </lable>
                <div class="upload-box" style="margin-right: 5px;margin-left: 10px">
                    <el-upload
                            action="https://api.nbyid.cn/mlcc/user/interface/uploadImage"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :on-remove="handleRemove"
                            :on-success="handleSuccess"
                            :file-list="imgurl"
                            :class="{hidePlusUpload: this.imgurl.length>=3}"
                            ref="upload"
                            >
                        <i class="el-icon-plus"></i>
                    </el-upload>
                    <el-dialog :visible.sync="dialogVisible">
                        <img width="100%" :src="dialogImageUrl" alt="">
                    </el-dialog>
                </div>
            </el-form-item>

            <el-form-item>
                <el-button class="only-btn" @click="save_liangti" style="background-color: #2D2D2D;color: #ffff00">保存量体信息</el-button>
            </el-form-item>>


        </el-form>
        <div class="staff-table-area" v-show="staffTableShow">
            <div style="margin-left:10px;margin-top:-10px"><strong>员工量体列表</strong></div>
            <div class="btn-area" style="margin-top:10px">
                <div style="margin-left:10px;">
                    <el-input placeholder="请输入关键词查询" v-model="queryName" style="width:200px"></el-input>
                    <el-select v-model="is_liangti" placeholder="请选择是否量体" style="margin-left: 10px">
                        <el-option
                                v-for="item in liangtioptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                        </el-option>
                    </el-select>
                    <el-button @click="querylistdata" style="background-color: #2d2d2d;color:#ffff00;margin-left: 10px">查询</el-button>
                    <el-button @click="resetdatalist" style="background-color: #2d2d2d;color:#ffff00;margin-left: 10px">重置</el-button>
                </div>
                <div style="float:right">
<!--                    <el-button type="default"  @click="staffTableShow = !staffTableShow" style="margin-right: 10px;">返回</el-button>-->
                    <el-button @click="staffTableShow = !staffTableShow" style="background-color: #2d2d2d;color:#ffff00;margin-left: 10px;margin-right: 10px">返回</el-button>
<!--                    <el-button type="primary"  @click="exportFun" style="background-color: #2d2d2d;margin-right: 10px;">导出</el-button>-->
                </div>

            </div>
            <!--员工量体列表 start-->
            <div class="staff-table">
                <el-table v-loading="loading" :data="editOrder.list" style="width: 100%" :row-class-name="rowClassName">
                    <el-table-column label="序号" type="index" width="80" prop="xh" align="center"></el-table-column>
                    <el-table-column prop="customerName" label="用户姓名" align="center"></el-table-column>
                    <el-table-column prop="customerCode" label="用户工号" align="center"></el-table-column>
                    <el-table-column prop="sex" label="用户性别" align="center"></el-table-column>
                    <el-table-column prop="liangtiStatus" label="量体状态" align="center">
<!--                        <template v-slot="props">-->
<!--                            <span v-if="props.row.status">已完成</span>-->
<!--                            <span v-if="!props.row.status">未完成</span>-->
<!--                        </template>-->
                    </el-table-column>
                    <el-table-column prop="liangtiRemark" label="备注" align="center"></el-table-column>
                    <el-table-column prop="productName" label="产品名称" align="center">
<!--                        <template v-slot="props">-->
<!--                            <el-button v-if="props.row.productName==''" type="text" size="small">未量体</el-button>-->
<!--                            <el-button v-if="props.row.productName!=''" type="text" size="small">{{props.row.productName}}</el-button>-->
<!--                        </template>-->
                    </el-table-column>

                    <el-table-column label="操作" align="center">
                        <template v-slot="props">
                            <el-button v-if="props.row.liangtiStatus=='已完成'" type="text" size="small" @click="seeliangtidetail(props.row.smallproductId,props.row.teamOrderSn)">查看量体数据</el-button>
                            <el-button v-if="props.row.liangtiStatus=='未完成'" type="text" size="small" :style="{ color: '#D5A606' }" @click="add_liangti(props.row.customerCode)">添加量体数据</el-button>
                            <el-button v-if="props.row.liangtiStatus=='已完成'" type="text" size="small" :style="{ color: '#e21948' }" @click="delete_liangti(props.row.smallproductId)">删除量体</el-button>
                        </template>
                    </el-table-column>
                </el-table>
<!--                <el-pagination background layout="prev, pager, next" :total="1000"> </el-pagination>-->
<!--                <el-pagination v-if="editOrder.list.length" background layout="prev, pager, next" :total="editOrder.pageTotal" :current-page.sync="editOrder.pageNo" :page-size="editOrder.pageSize" @current-change="pageChangePage"></el-pagination>-->

                <el-pagination
                        background
                        layout="prev, pager, next"
                        :total="xiuzipageTotal3"
                        :page-size="xiuzipageSize3"
                        :pager-count="xiuzipagerCount3"
                        @next-click="xiuzicurrentPage+=1,xiuzi_handleCurrentChange3"
                        @prev-click="xiuzicurrentPage-=1,xiuzi_handleCurrentChange3"
                        @current-change="xiuzi_handleCurrentChange3"
                >
                </el-pagination>

            </div>
            <!--员工量体列表 end-->
        </div>

		<!-- 这里放的是抽屉啦-->
		<el-drawer
		  title="量体信息"
		  :visible.sync="drawer"
		  size="50%"
		  >
		 <div class="list">
		 	<div class="list-div"  style="overflow: hidden;">
		 		<div v-for="(item,i) in liangtidetailList">
		 			<p style="float: left;" v-show="item.bodysize_value!==null && item.bodysize_value!=='null' && item.bodysize_value!=='' && item.bodysize_value!==' '">
						<el-button type="primary" style="color: #F9D532;width: 100px;height: 36px;background: #333333;border-style: none;margin-top: 15px;margin-left: 10px">{{item.body_sizename}}</el-button>&nbsp;
<!--                        <el-button  style="color: black;width: 80px;height: 36px;background: white;border-style: none;" v-show="item.bodysize_value==null || item.bodysize_value=='' || item.bodysize_value=='null'"> </el-button>&nbsp;-->
					    <el-button  style="color: black;width: 80px;height: 36px;background: white;border-style: none;" >{{item.bodysize_value}}</el-button>&nbsp;
					</p>
		 		</div>
		 	</div>
		 </div>

		  <div class="list">
		  	<div class="list-div" style="overflow: hidden;">
<!--                <span style="margin-left: 10px;font-weight: bolder;margin-top: 20px">量体图片：</span>-->
		  	<div v-for="item in liangtiimgs" v-show="item!==null && item!==''">
		  		<img :src="item"
                     style="float: left;margin-left: 20px;width: 100px;height: 100px;margin-top: 20px;"/>
		  	</div>
		</div>
		</div>

		<div class="list" style="margin-top: 18px">
			<p style="margin-left: 20px"><b>备注：</b>{{liangtiremark}}</p>
			</div>
		</el-drawer>
    </div>


</template>

<script>
    import Vue from "vue";

    let storage = window.localStorage;
    import Qs from "qs";
    import { deleteAction, postAction, getAction } from '@/api/manage'
    export default {
        name: 'measureInfo',
        data() {
            return {
                imgnum:0,
                imgurl:[],
                liangtiImg:'',
				liangtiimgs:[],
				liangtiremark:'',
				drawer: false,
				liangtidetailList:[],//点击查看量体数据时存放的数组
                loading: false,//数据加载
                //用户信息
                customerName:'',
                customerCode:'',
                customerSex:'',
                customerId:'',//客户id
                departId:'',//所属部门id
                productlists:[],//产品列表
                categoryIds:'',//选中的类别ids
                standbodySize:[],//标准尺寸
                bodysizes1:[],
                bodysizes2:[],
                sizeData: [], //成衣尺寸，净体尺寸
                // chengyiObject: this.$store.state.OrderUser.EditbodySizeIds,//成衣选中数据集
                chengyiObject:'',
                remark:'',
                filstimg:'',
                select_size:"请选择尺码类型",
                sizetype: [{
                    value: '0',
                    label: '自定义尺码'
                }, {
                    value: '1',
                    label: '标准尺码'
                }],
                bzbodysize: [],//标准尺码
                biaozhunma:'请选择',//选中的标准码
                staffTableShow: false,
                firstsize:'',
                bodySizeIds:'',//填写的尺码
                sizeIds:'',//身形数据
                liangtiRemark:'',//备注
                dialogImageUrl:'',//图片
                dialogVisible: false,
                sizeTypeList:[],
                measureFrom: {
                    searchKeyWord: '',
                    clothingType: '1',
                    clothingList: []
                },

                liangtioptions:[
                    {
                        value: '0',
                        label: '全部'
                    },
                    {
                        value: '1',
                        label: '未量体'
                    }, {
                        value: '2',
                        label: '已量体'
                    }
                ],
                is_liangti:'0',//选择是否量体
                queryName:'',//关键词搜索

                //部门列表数据
                tableData: [
                    {
                        number: 1,
                        sex: '男',
                        proId: '2264AA',
                        name: 'XX',
                        nameNumber: 2,
                        status: 1
                    },
                    {
                        number: 1,
                        sex: '男',
                        proId: '2264AA',
                        name: 'XX',
                        nameNumber: 2,
                        status: 0
                    }
                ],

                editOrder: {
                    list: [],
                    pageNo: 1,
                    pageTotal: 0,
                    pageSize: 10,
                    pagerCount:5
                },
                xiuzipageTotal3: 20, // 总条目
                xiuzipageSize3: 10, // 页面大小
                xiuzicurrentPage3: 1, // 当前页
                xiuzipagerCount3: 5, // 总共有几页

                url: {
                    show_customerDetail: '/logic/interface/query_customerDetailById',//查询客户详情
                    show_depart_products: '/logic/interface/query_productsBydepartId',
                    show_productsDetail: '/logic/interface/query_productDetailById',//查询产品
                    query_bodySizeinfo: '/logic/interface/query_bodySizeinfo',//尺寸
                    querybiaozhun_size: '/teamOrder/sizeChose',
                    save_liangti:'/logic/interface/save_team_userLiangtiInfo',//保存量体
                    show_liaingti_datalist:'/logic/interface/query_lianngtiListBycustomerId',//查询量体列表
					liangtidetail:'/measuring/liangtidetail'//点击查看量体信息详情
                },
            };
        },
        created() {
            this.is_liangti='0';
            this.queryName='';
            this.querylistdata();//查询数据
        },
        methods:{
            yanzhengChange(isbitian,min,max,inputvalue){//验证
                // 判断是否要判断范围
                let is_limit_min = min !== null && min !== '' && min !== undefined;
                let is_limit_max = max !== null && max !== '' && max !== undefined;
                this.inputnum = inputvalue*1;
                max = max*1;
                min = min*1;
                var reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
                // 必填时判断是否填写
                if(isbitian=='1'){
                    if(inputvalue==null || inputvalue==undefined || inputvalue==''){
                        this.$message.warning("该项是必填项,请输入尺寸")
                        return
                    }
                }
                // 有值时判断输入的值是否合理
                if(inputvalue!==null && inputvalue!==undefined && inputvalue!==''){
                    if(!reg.test(this.inputnum)){
                        this.$message.warning("请输入正确的尺寸")
                        return
                    }
                    //如果有范围、判断是否在范围内
                    if (is_limit_min && this.inputnum<min){
                        this.$message.warning("该项最小值不能小于"+min)
                        return
                    }
                    if(is_limit_max && this.inputnum>max){
                        this.$message.warning(this.inputnum+"该项最大值不能超过"+max)
                        return
                    }
                }
            },
            delete_liangti(id){//删除量体
                let params2 = {smallproductId:id};
                postAction(domain.publicUrl+"/logic/interface/delete_smallproducts_bodysize",Qs.stringify(params2)).then(res=>{
                    let result = res.data;
                    if(result.code==0){
                        this.$message.success("操作成功");
                        this.querylistdata();
                    }else {
                        this.$message.error("操作失败");
                    }
                });
            },
            rowClassName({ row, rowIndex }) {
                row.xh = rowIndex + 1;
            },
			//查看量体数据详情
			seeliangtidetail(smallproductId,teamorderSn){
				this.drawer = true;
				getAction(domain.publicUrl+this.url.liangtidetail,{'smallproductId':smallproductId,'teamorderSn':teamorderSn}).then(res=>{
				   this.liangtidetailList=res.data.data;
				   this.liangtiremark=res.data.liangtiremark;
				   if(res.data.imgs==null || res.data.imgs.length<1){
                       this.liangtiimgs=[];
                   }else {
                       this.liangtiimgs=res.data.imgs;
                   }

				});
			},
            insertTo_liangti(){//进入量体列表
			    this.staffTableShow=true;
                this.editOrder.list=[];
			    this.querylistdata();
            },
            handleRemove(file, fileList) {
                let delImgIndex = null;
                this.imgurl.map((d, index) => {
                    if (file.url == d.url) {
                        delImgIndex = index;
                        // console.log('0',d.url, '1')
                    }
                })

                if (delImgIndex !== null) {
                    this.imgurl.splice(delImgIndex, 1)
                }

                // this.$refs.upload.clearFiles()
            },
            //上传图片成功函数
            handleSuccess(response,file, fileList) {
                var result = response;
                this.imgurl.push({
                    name:result.data,
                    url:result.data,
                    uid: result.data,
                })

                // this.dialogImageUrl = "";
                // this.imgnum++;
                // this.imgurl.map((d,index)=> {
                //     if (index != 0) {
                //         this.dialogImageUrl += ",";
                //     }
                //     this.dialogImageUrl += d.url
                //
                // })
                // console.log(this.dialogImageUrl)
                // var result = response;
                // this.dialogImageUrl += result.data+",";
                // this.imgnum++;
            },
            setDialogImageUrl(){
                this.dialogImageUrl = "";
                this.imgurl.map((d,index)=> {
                    if (index != 0) {
                        this.dialogImageUrl += ",";
                    }
                    this.dialogImageUrl += d.url

                })
            },
            handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
            },
            show_customer(){
                if(this.measureFrom.searchKeyWord==null || this.measureFrom.searchKeyWord==''){
                    this.$message.warning("请输入员工编号")
                    return;
                }
                let params = {customerId:storage.getItem('customerId'),code:this.measureFrom.searchKeyWord};
                postAction(domain.publicUrl+this.url.show_customerDetail,Qs.stringify(params)).then(res=>{
                    let result = res.data;
                    // console.log(result)
                    if(result.code==0){
                        this.customerId = result.data.id;
                        this.departId = result.data.departId;
                        this.customerName = result.data.customerName;
                        this.customerCode = result.data.customerCode;
                        if(result.data.sex=='1'){
                            this.customerSex='男'
                        }else {
                            this.customerSex='女'
                        }
                        let params2 = {departId:this.departId,sex:result.data.sex};
                        postAction(domain.publicUrl+this.url.show_depart_products,Qs.stringify(params2)).then(res=>{
                            let result = res.data;
                            if(result.code==0){
                                this.productlists=result.data;
                            }else {
                                this.$message.warning("该员工下暂未有符合的产品");
                            }
                        });
                    }else{
                        this.customerId = '';
                        this.departId = '';
                        this.customerName = '';
                        this.customerCode = '';
                        this.customerSex = '';
                        this.productlists=[];
                        this.$message.error("暂无该员工数据")
                    }
                })
            },
            select_bodysize(){//根据选中的产品查询尺寸
                this.liangtiImg = '';
                this.liangtiRemark='';
                this.imgurl=[];
                this.imgnum--;
                let params10 = {productId:this.categoryIds,customerId:this.customerId,orderSn:storage.getItem('orderSn')};
                // alert(storage.getItem('orderSn'))
                postAction(domain.publicUrl+"/logic/interface/query_smallproductInfoByType",Qs.stringify(params10)).then(res=> {
                    let result = res.data;
                    if (result.code == 0) {//有数据
                        if(result.data.bodysType=='0'){
                            this.select_size='0'
                            Vue.set(this.sizeData,'成衣尺寸',result.data.bodySizeInfoList1);
                            Vue.set(this.sizeData,'净体尺寸',result.data.bodySizeInfoList2);
                        }else {
                            this.select_size='1'
                            this.biaozhunma=result.data.standardSize
                        }
                        this.liangtiRemark=result.data.liangtiRemark;
                        if(result.data.imglists != null && result.data.imglists !=''){
                            this.liangtiImg = result.data.imglists
                            this.imgurl = result.data.imglists.map(d => {
                                return {
                                    name: d,
                                    url: d
                                    }
                                }
                            )
                            // console.log("svs11="+result.data.imglists.length)
                        }else {
                            console.log("svs22="+result.data.imglists)
                            this.imgurl=[];
                        }
                    }else {//没有数据
                        this.chengyiObject='';
                        this.select_size="请选择尺码类型"
                        this.liangtiRemark=''
                        let params2 = {productId:this.categoryIds};
                        postAction(domain.publicUrl+this.url.show_productsDetail,Qs.stringify(params2)).then(res=>{
                            let result = res.data;
                            if(result.code==0){
                                let params3 = {template_id:'5',is_jin:'0',category_ids:result.data.categoryIds};
                                postAction(domain.publicUrl+this.url.query_bodySizeinfo,Qs.stringify(params3)).then(res=>{
                                    let result = res.data;
                                    if(result.code==0){
                                        Vue.set(this.sizeData,'成衣尺寸',result.data);
                                    }else {
                                        // this.$message.success(result.msg);
                                    }
                                });
                                let params4 = {template_id:'5',is_jin:'1',category_ids:result.data.categoryIds};
                                postAction(domain.publicUrl+this.url.query_bodySizeinfo,Qs.stringify(params4)).then(res=>{
                                    let result = res.data;
                                    if(result.code==0){
                                        Vue.set(this.sizeData,'净体尺寸',result.data);
                                    }else {
                                        // this.$message.success(result.msg);
                                    }
                                });
                                this.biaozhunma='';
                                this.select_sizeType(result.data.categoryIds);
                            }else {
                                // this.$message.success(result.msg);
                            }
                        });
                    }
                })
            },
            select_sizeType(categoryIds2){//查询尺寸详情
                let params2 = {categoryIds:categoryIds2};
                postAction(domain.publicUrl+this.url.querybiaozhun_size,Qs.stringify(params2)).then(res=>{
                    let result = res.data;
                    if(result.code==0){
                        this.bzbodysize = result.data;
                        // alert("==="+this.children[0].standardName);
                    }else {
                        // this.$message.success(result.msg);
                    }
                });
            },
            save_liangti(){//提交量体信息
                if(this.measureFrom.searchKeyWord==null || this.measureFrom.searchKeyWord==''){
                    this.$message.warning("请输入员工编号")
                    return;
                }
                if(this.customerId==''){
                    this.$message.warning("请输入员工编号")
                    return;
                }
                if(this.categoryIds==''){
                    this.$message.warning("请选择产品")
                    return;
                }
                if(this.select_size=='请选择尺码类型'){
                    this.$message.warning("请选择尺码类型");
                    return;
                }
                if(this.select_size=='1'){
                    if(this.biaozhunma=='请选择'){
                        this.$message.warning("请选择具体尺码");
                        return;
                    }
                }else {
                    if(this.biaozhunma=='请选择'){
                        this.biaozhunma='';
                    }
                    // this.pinbodySizeIds();//拼接
                }
                this.pinbodySizeIds();//拼接
                this.setDialogImageUrl();//pingjieImg
                // alert(this.categoryIds+"==="+this.chengyiObject+"==="+this.bodySizeIds)
                let params2 = {
                    token:localStorage.getItem("token"),
                    teamOrderSn:storage.getItem('orderSn'),
                    productId:this.categoryIds,
                    customerId:this.customerId,
                    departId:this.departId,
                    bodysType:this.select_size,//尺寸类型
                    bodySizeIds:this.bodySizeIds,
                    sizeIds:this.sizeIds,
                    liangtiRemark:this.liangtiRemark,
                    standardSize:this.biaozhunma,
                    liangtiImgs:this.dialogImageUrl
                };
                // console.log(params2);
                postAction(domain.publicUrl+this.url.save_liangti,Qs.stringify(params2)).then(res=>{
                    let result = res.data;
                    if(result.code==0){
                        this.$message.success(result.msg);
                        this.chengyiObject='';
                        this.bodySizeIds='';
                        // this.measureFrom.searchKeyWord='';
                        // this.categoryIds='';
                        // this.customerId='';
                        // this.departId='';
                        // this.select_size='请选择尺码类型';
                        // this.this.biaozhunma='请选择';
                        // this.upload.clearFiles();
                        //刷新量体人员
                        this.is_liangti='0';
                        this.queryName='';
                        this.querylistdata();//查询数据
                    }else {
                        this.$message.error(result.msg);
                    }
                });
            },
            selectSizeType(index){
                console.log(index)
            },
            pinbodySizeIds(){//拼接数据
                // log(value, this.sizeData['成衣尺寸']);return;
                    let arr='';
                    for(let i=0; i<this.sizeData['成衣尺寸'].length;i++) {
                        let x = this.sizeData['成衣尺寸'][i];
                        if(arr == '') {
                            if(x.bodySizevalue==null || x.bodySizevalue==''){
                                arr = x.id + '/' + ' ';
                            }else {
                                arr = x.id + '/' + x.bodySizevalue;
                            }
                        }else {
                            if(x.bodySizevalue==null || x.bodySizevalue==''){
                                arr += ',' + x.id + '/' + ' ';
                            }else {
                                arr += ',' + x.id + '/' + x.bodySizevalue;
                            }
                        }
                    }
                for(let i=0; i<this.sizeData['净体尺寸'].length;i++) {
                    let x = this.sizeData['净体尺寸'][i];
                    if(arr == '') {
                        if(x.bodySizevalue==null || x.bodySizevalue==''){
                            arr = x.id + '/' + ' ';
                        }else {
                            arr = x.id + '/' + x.bodySizevalue;
                        }
                    }else {
                        if(x.bodySizevalue==null || x.bodySizevalue==''){
                            arr += ',' + x.id + '/' + ' ';
                        }else {
                            arr += ',' + x.id + '/' + x.bodySizevalue;
                        }
                    }
                }
                this.bodySizeIds = arr;
            },
            // pinbodySizeIds(){//拼接数据
            //     let arr = '';
            //     for(let x in this.chengyiObject) {
            //         if(arr == '') {
            //             arr = x + '/' + this.chengyiObject[x];
            //         }else {
            //             arr += ',' + x + '/' + this.chengyiObject[x];
            //         }
            //     }
            //     this.bodySizeIds = arr;
            // },
            /**
             * @Date: 2020-11-16 11:12:46
             * @LastEditors: qwguo
             * @description: 点击导出方法
             * @param {type} 参数说明
             * @return: 返回值
             */
            exportFun() {
                // this.staffTableShow = false;
                postAction(domain.publicUrl+"/logic/interface/Excel_product_user").then(res=>{
                    let result = res.data;
                    if(result.code==0){
                        this.$message.success("导出成功")
                    }else {
                        this.$message.error(result.msg)
                    }
                });
            },
            //分页
            xiuzi_handleCurrentChange3(val){
                this.xiuzicurrentPage3 = val
                this.querylistdata();
            },
            // pageChangePage(index) {
            //     this.activeItem.pageNo = index;
            //     this.querylistdata();
            // },
            querylistdata(){// 条件搜索
                let that = this;
                that.editOrder.list.splice(0, that.editOrder.list.length);
                let params2 = {
                    token:localStorage.getItem("token"),
                    partmentId:storage.getItem('customerId'),
                    pageNo: this.xiuzicurrentPage3,
                    pageSize: 10,
                    queryName:this.queryName,
                    is_liangti:this.is_liangti
                };
                postAction(domain.publicUrl+this.url.show_liaingti_datalist,Qs.stringify(params2)).then(res=>{
                    let result = res.data;
                    if(result.code==0){
                        let getData = res.data.data;
                        getData.records.forEach(v => {
                            that.editOrder.list.push(v);
                        });
                        this.xiuzipageTotal3 = res.data.data.total
                        this.xiuzipageSize3 = res.data.data.size
                        this.xiuzipagerCount3 = 5
                        this.loading=false;
                    }else {
                        let getData = res.data.data;
                        that.editOrder.pageTotal = '0';
                        getData.records.forEach(v => {
                            that.editOrder.list.push(v);
                        });
                        this.loading=false;
                    }
                });
                // alert(this.queryName);
            },
            resetdatalist(){//重置
                //刷新量体人员
                this.is_liangti='0';
                this.queryName='';
                this.querylistdata();//查询数据
            },
            add_liangti(code){//添加量体
                this.staffTableShow = false;
                this.measureFrom.searchKeyWord=code;
                this.productlists='';
                this.show_customer();
                this.select_bodysize();
            }
        }
    };
</script>

<style lang="scss">

    .GO-measure-info-wrap {
        .measure-form {
            padding: 20px 40px;
        }
        .bh-item {
            .only-btn {
                background-color: #fcec83;
                border-color: #fcec83;
                color: #515151;
            }
        }
        .staff-list {
            .li-item {
                display: flex;
                padding-top: 20px;
                .s-item {
                    height: 36px;
                    border: 1px solid rgba(249, 249, 249, 1);
                    display: inline-flex;
                    margin-right: 30px;
                    line-height: 1;
                    align-items: center;
                    justify-content: stretch;
                    color: #4f4f4f;
                    font-size: 15px;
                }
                .label {
                    background-color: rgba(249, 249, 249, 1);
                    width: 112px;
                    height: 100%;
                    display: inline-flex;
                    align-items: center;
                    padding: 0 0 0 20px;
                }
                .val {
                    width: 140px;
                    padding: 0 20px;
                }
            }
        }
        .size-type-form-item{
            .el-input{
                display: none;
            }
            .el-menu-demo{
                display: inline-block;
                border-radius: 5px;
                border: 1px solid #ccc;
                .is-active{
                    .el-submenu__title{
                        border-bottom: 0;
                    }
                }
                .el-submenu__title{
                    height: 40px;
                    line-height: 40px;
                    &:hover{
                        background-color: transparent;
                    }
                }
            }
        }
        .clothing-type {
            padding: 20px 0;
        }
        .el-radio-group {
            padding-bottom: 0;
            .el-radio-button {
                margin-right: 10px;
                .el-radio-button__inner {
                    border: 1px solid rgba(242, 242, 242, 1);
                    border-radius: 5px;
                    color: #9d9d9d;
                    font-weight: 400;
                    padding: 8px 15px;
                }
                &:hover {
                    .el-radio-button__inner {
                        box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.129411764705882);
                        border-radius: 5px;
                        color: rgb(74, 74, 74);
                        font-weight: 700;
                    }
                }
                &.is-active {
                    .el-radio-button__inner {
                        background-color: rgba(255, 236, 112, 1);
                        color: rgb(74, 74, 74);
                        box-shadow: none;
                        font-weight: 700;
                    }
                }
            }
        }
        .el-form-item__label {
            padding-right: 20px;
        }
        .size-input-box {
            margin-bottom: 20px;
            display: flex;
            position: relative;
            .el-button {
                margin-right: -5px;
                position: relative;
                z-index: 2;
                width: 52px;
                padding: 12px 5px;
                font-weight: 200;
            }
            .unit {
                position: absolute;
                font-size: 12px;
                top: 0;
                bottom: 0;
                right: 10px;
                font-style: normal;
            }
        }
        .el-input-number {
            margin-right: 10px;
        }
        .upload-form-item {
            .upload-box {
                display: flex;
            }
            .upload-item {
                margin-right: 10px;
            }
            .el-upload {
                width: 104px;
                height: 104px;
                line-height: 104px;
            }
        }
        .staff-table-area {
            .btn-area {
                border-bottom: 1px solid #ccc;
                margin: 0 0 20px;
                padding: 0 0 20px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                .export-btn {
                    color: #fff !important;
                    margin-right: 40px;
                }
                strong {
                    display: inline-flex;
                    align-items: center;
                    height: 30px;
                    border-left: 5px solid #6f6f6f;
                    padding-left: 40px;
                }
            }
        }
        .staff-table {
            margin: 0 40px;
            thead {
                th {
                    background-color: #3c3c3c;
                    color: #fcec83;
                    border-right: 1px solid #fff;
                }
            }
            tbody {
                td {
                    background-color: #f9f9f9;
                    border-right: 1px solid #fff;
                }
            }
            .el-pagination {
                text-align: center;
            }
        }
    }
    .hidePlusUpload .el-upload--picture-card {
        display: none;
    }
</style>
